<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<script type="text/javascript" charset="utf-8"
		src="<%=basePath%>ueditor/editor_all.js"></script> 
<script type="text/javascript" charset="utf-8"
		src="<%=basePath%>ueditor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript" charset="utf-8"
		src="<%=basePath%>ueditor/editor_config.js"></script>
<div id='message'>
   
</div>
<form action="<%=basePath%>backend/updatexyxx" class='form-horizontal' method="post" id='xyForm' enctype="multipart/form-data">
	<div class="row-fluid">
		<c:if test="${not empty xy.xyImg }">
			<div class="span7 input-prepend"
				style='margin-left:100px;height:100px;'>

				<div class="input-prepend">
					<span class="add-on">校友头像</span> <img alt=""
						src="<%=basePath%>${xy.xyImg }"
						style='width: 100px; height: 80px;'>
				</div>


			</div>
		</c:if>
		<div class='span12 div-common control-group' style='margin-left:100px;'>
			<div class="span7 " style='height: 100px;'>
				<div class="control-group">
					<label class="control-label">图&nbsp;片&nbsp;上&nbsp;传（<span
						style='color: #990000;'>如果不修改校友头像，可不选择</span>）:
					</label>
					<div class="controls">
					<input type="file" class='form-control' name="fileste"
						id="picture" />
                     </div>
				</div>
			</div>
			<div class="span5" id="photo">
				<font color="red">你添加了的图片：</font> <br>
			</div>
		</div>


	</div>
	<div class="row div-common"  style='margin-top: 10px;'>
		<div class="span6 input-prepend" style='margin-left: 15px;'>
			<span class="add-on">姓名</span> <input name="xyName" type="text"
				value='${xy.xyName }' />

		</div>

		<span></span>
	</div>
	<div class="row div-common" style='margin-top: 10px;'>


		<!-- Optional: clear the XS cols if their content doesn't match in height -->


		<div class="span5 input-prepend" style='margin-left: 15px;'>
			<span class="add-on">类别</span> 
			<select class="span6" id='xytype'
				name='xytype'>
				<option value='0'>---请选择---</option>
				<c:forEach items="${ xyTypes}" var="major">
					<option value="${major.xytId }">${major.xytName }</option>
				</c:forEach>
			</select>

		</div>
		<div class="span5 input-prepend"
			style='margin-top: 10px; margin-left: 15px;'>
			<span class="add-on">级别</span> <select class="span6" id='xyjb'
				name='xyjb'>
				<option value='0'>---请选择---</option>
				<c:forEach items="${ xyjbs}" var="major">
					<option value="${major.xyjbId }">${major.xyjbName }</option>
				</c:forEach>
			</select>

		</div>
		<span></span>
	</div>
	<div class='row div-common'>
		<div class="span5 input-prepend"
			style='margin-top: 10px; margin-left: 15px;'>
			<span class="add-on">导师</span> <select class="span6" id='teacher'
				name='teacher'>
				<option value='0'>---请选择---</option>
				<c:forEach items="${ teteacherytpes}" var="major">
					<option value="${major.tId.id }">${major.tId.name }</option>
				</c:forEach>
			</select>

		</div>
		<span></span>
		<div class="span5 input-prepend"
			style='margin-top: 10px; margin-left: 15px;'>
			<span class="add-on">界数</span> <select class="span6" id='xyJs'
				name='xyJs'>
				<option value='0'>---请选择---</option>
				<c:forEach begin="1990" end="2014" step="1" var="i">
					<option value="${i }">${i }</option>
				</c:forEach>
			</select>

		</div>
	</div>
	<span></span>



	<div class='div-common'>
		<strong>简介</strong><br>
		<br>
		<script id="editor"></script>
	</div>

	<input type="submit" value="完成" style="margin-left: 600px;margin-top: 10px;" class="btn btn-info" onclick="return getContent();"/></div>
		<input id="content1" type="hidden" name="xyIntro" value="${xy.xyIntro }">
		<input id='type' name='' type="hidden" value='${xy.xytId.xytId }' >
		<input id='jb' name='' type="hidden" value='${xy.xyJb.xyjbId }' > 
		<input id='tea' name='' type="hidden" value='${xy.tId.id }' > 
		<input id='js' name='' type="hidden" value='${xy.xyJs }' > 
		<input  name='xyId' type="hidden" value='${xy.xyId }' >
	</form>
	
	<script type="text/javascript">
		var editor = new UE.ui.Editor();
		editor.render("editor");
		$(function() {
			var content = $("#content1").val();

			editor.ready(function() {
				editor.setContent(content);
			});
		});
		$("#xyjb").val($("#jb").val());
		$("#xytype").val($("#type").val());

		$("#teacher").val($("#tea").val());
		$("#xyJs").val($("#js").val());
		var ue = UE.getEditor('editor');
		function getContent() {
			var str = ue.getContent();
			$("#content1").val(str);
			var str = "";
			return true;
		}
	</script>
